package com.lyqg;

import java.text.DateFormat;
import java.text.SimpleDateFormat;

import org.springframework.beans.factory.InitializingBean;

import com.core.SpringContextHolder;

public class Config implements InitializingBean {

	static Config config;

	private String webRoot; // Web项目部署根路径

	private String userAvatar; // 用户头像图片路径

	/**
	 * 返回Web项目部署根目录
	 * 
	 * @return
	 */
	public static String getWebRoot() {
		return config.webRoot;
	}

	public void setWebRoot(String webRoot) {
		this.webRoot = webRoot;
	}

	public static String getUserAvatar() {
		return config.userAvatar;
	}

	public void setUserAvatar(String userAvatar) {
		this.userAvatar = userAvatar;
	}

	@Override
	public void afterPropertiesSet() throws Exception {
		config = (Config) SpringContextHolder.getBean("baseConfig");
	}

	/**
	 * 日期格式化对象
	 */
	public static final DateFormat MONTH_FORMAT = new SimpleDateFormat(
			"/yyyy/MM");

}
